﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using System.Data.SqlClient;
using System.Windows.Forms;

using HotelManagement.Connector;

namespace HotelManagement.DAO
{
    class RoomBookingManagementDAO
    {
        DA_QLKSDataSet.QUANLI_PHIEU_DK_PHONG_TIM_KHDataTable table;

        public RoomBookingManagementDAO()
        {
        }

        public DataTable search(string customerName)
        {
            DA_QLKSDataSetTableAdapters.QUANLI_PHIEU_DK_PHONG_TIM_KHTableAdapter adapter =
                new DA_QLKSDataSetTableAdapters.QUANLI_PHIEU_DK_PHONG_TIM_KHTableAdapter();

                table = new DA_QLKSDataSet.QUANLI_PHIEU_DK_PHONG_TIM_KHDataTable();

            adapter.Fill(table, customerName);

            return table;
        }

        public void update(string roomCode, int nPeople, DateTime inDate, DateTime outDate,
            int customerCode)
        {
            DA_QLKSDataSetTableAdapters.QueriesTableAdapter adapter =
                new DA_QLKSDataSetTableAdapters.QueriesTableAdapter();

            adapter.QUANLI_PHIEU_DK_THAYDOI_PHIEU_DANGKI(roomCode, nPeople, inDate, outDate, customerCode);
        }

        public void erase(string roomCode)
        {
            DA_QLKSDataSetTableAdapters.QueriesTableAdapter adapter =
                new DA_QLKSDataSetTableAdapters.QueriesTableAdapter();

            adapter.QUANLI_PHIEU_DK_HUY_PHONG(roomCode);
        }
    }
}
